import {BSFormatParser} from "./BSFormatParser"

class BSFormatParserV2 extends BSFormatParser {
  constructor(item, data) {
    super(item, data);
    console.log("V2 Song")
  }

  getRequirements(diffName){
    for(const diffSet of this.data._difficultyBeatmapSets){
      for(const item of diffSet._difficultyBeatmaps){
        if(diffName == item._difficulty)
          return item._requirements;
      }
    }
  }

  getDiffFile(diffName){
    for(const diffSet of this.data._difficultyBeatmapSets){
      for(const item of diffSet._difficultyBeatmaps){
        if(diffName == item._difficulty)
          return item._beatmapFilename;
      }
    }
  }
  
  getSongFileName() {
    return this.data["_songFilename"] || "";
  }

  getRawBpm(){
    return this.data["_beatsPerMinute"] || 0;
  }
}

export {BSFormatParserV2}